package com.sky.mapper.admin;


import com.sky.dto.EmployeeDTO;
import com.sky.dto.EmployeePageQueryDTO;
import com.sky.param.EemInsertParam;
import com.sky.pojo.Employee;
import org.apache.ibatis.annotations.*;

import java.util.List;


@Mapper
public interface EmployeeMapper {

    /**
     * 根据用户名查询员工
     * @param username
     * @return
     */
    @Select("select * from employee where username = #{username}")
    Employee getByUsername(String username);


    /**
     * 分页查询
     * @param param  分页查询条件
     * @return 查询结果集合
     */
    List<Employee> selectEmpbyPage(@Param("p") EmployeePageQueryDTO param);


    EmployeeDTO getById(@Param("id") Long id);

    int insert(@Param("p") Employee emp);

    @Update("update employee set status = #{status} where id = #{id}")
    int statusUpdate(@Param("status") Integer status, @Param("id") Long id);

    @Select("select * from employee where id = #{id}")
    Employee selectEmpById(@Param("id") Long id);

    int update(@Param("p") Employee param);
}
